namespace CodeConsult.Nordic.nRF8001.ApplicationControlInterface.Events.DataEvents
{
    public class PipeErrorEvent : AciEventBase
    {
        public const byte OpCode = 0x8D;
 
        public byte ServicePipeNo { get; set; }
        public byte ErrorCode { get; set; }
        public byte[] ErrorData { get; set; }

        protected override void DecodeFromBuffer()
        {
            var errorDataLen = DecodeHelper.BufferLength - 3;
            ServicePipeNo = DecodeHelper.GetByte();
            ErrorCode = DecodeHelper.GetByte();
            ErrorData = DecodeHelper.GetBytes(errorDataLen);
        }
    }
}
